<ul class="sidebar-menu" data-widget="tree">
        <li class="header">后台菜单</li>
        <!-- Optionally, you can add icons to the links -->
        <li><a href="/admin/index"><i class="fa fa-home" aria-hidden="true"></i> <span>首页</span></a></li>
        <li class="treeview">
          <a href="#"><i class="fa fa-link"></i> <span>招教管理</span>
            <span class="pull-right-container">
                <i class="fa fa-angle-left pull-right"></i>
              </span>
          </a>
          <ul class="treeview-menu">
            <li><a href="/article/index"><i class="fa  fa-genderless"></i>&nbsp;招教信息</a></li>
          </ul>
        </li>
</ul>
<script>
$(function(){
    var url 		= "/<?php echo @$url_router?>";
    var url_source 	= "/<?php echo @$url_source?>";
	
    if(!add_active(url))
    {
    	add_active(url_source)
    }
})


function add_active(url){
	   var active = false;
	   $(".sidebar-menu li a").each(function(){
			if($(this).attr('href') == url)
			{
				$(this).parent('li').addClass('active');

				$is_class = $(this).parent('li').parent().hasClass("treeview-menu");
				if($is_class){
					$(this).parent('li').parent().parent().addClass('menu-open');
					$(this).parent('li').parent().parent().addClass('active');
				}
				active = true;
			}else{
					$(this).parent('li').removeClass('active');
			}
	    })

	    return active;
}

</script>